home *** CD-ROM | disk | FTP | other *** search
/ PC World Komputer 2010 April / PCWorld0410.iso / hity wydania / Ubuntu 9.10 PL / karmelkowy-koliberek-9.10-netbook-remix-PL.iso / casper / filesystem.squashfs / usr / share / pyshared / glchess / defaults.py < prev    next >
Encoding:
Python Source  |  2009-09-22  |  4.1 KB  |  84 lines

  1. # -*- coding: utf-8 -*-
  2. #
  3. # defaults.py.in sets many important default global variables
  4. # used throughout the game. Note that this file is processed by
  5. # automake to set prefix paths etc. Please keep defaults.py.in
  6. # in sync between glchess and gnome-sudoku. 
  7.  
  8. import os, os.path
  9. import errno
  10. import gettext 
  11.  
  12. root_dir = os.path.dirname(__file__)
  13. if not os.path.exists(os.path.join(root_dir, 'Makefile.am')):
  14.     # Running in installed mode
  15.     APP_DATA_DIR     = os.path.join('/usr', 'share')
  16.     BASE_DIR         = os.path.join(APP_DATA_DIR, 'glchess')
  17.     TEXTURE_DIR      = os.path.join(BASE_DIR, 'textures')
  18.     UI_DIR           = BASE_DIR
  19.     LOCALEDIR        = os.path.join(APP_DATA_DIR, 'locale')
  20.     DATA_DIR         = os.path.expanduser('~/.gnome2/glchess/')
  21.     LOG_DIR          = os.path.join(DATA_DIR, 'logs')
  22.     CONFIG_FILE      = os.path.join(DATA_DIR, 'config.xml')
  23.     HISTORY_DIR      = os.path.join(DATA_DIR, 'history')
  24.     UNFINISHED_FILE  = os.path.join(HISTORY_DIR, 'unfinished')
  25.     LOCAL_AI_CONFIG  = os.path.join(DATA_DIR, 'ai.xml')
  26.     GGZ_DIR          = os.path.expanduser('~/.ggz')
  27.     GGZ_CONFIG_FILE  = os.path.join(GGZ_DIR, 'ggz-gtk.rc')
  28. else:
  29.     # Running in uninstalled mode
  30.     APP_DATA_DIR     = os.path.join(root_dir, '../../data')
  31.     TEXTURE_DIR      = os.path.join(root_dir, '../../textures')
  32.     UI_DIR           = os.path.join(root_dir, '../../data')
  33.     BASE_DIR         = os.path.join(root_dir, '../../data')
  34.     LOCALEDIR        = os.path.join(APP_DATA_DIR, 'locale')
  35.     DATA_DIR         = os.path.expanduser('~/.gnome2/glchess/')
  36.     LOG_DIR          = os.path.join(DATA_DIR, 'logs')
  37.     CONFIG_FILE      = os.path.join(DATA_DIR, 'config.xml')
  38.     HISTORY_DIR      = os.path.join(DATA_DIR, 'history')
  39.     UNFINISHED_FILE  = os.path.join(HISTORY_DIR, 'unfinished')
  40.     LOCAL_AI_CONFIG  = os.path.join(DATA_DIR, 'ai.xml')
  41.     GGZ_DIR          = os.path.expanduser('~/.ggz')
  42.     GGZ_CONFIG_FILE  = os.path.join(GGZ_DIR, 'ggz-gtk.rc')
  43.  
  44. DOMAIN = 'gnome-games'
  45. gettext.bindtextdomain(DOMAIN, LOCALEDIR)
  46. gettext.textdomain(DOMAIN)
  47. from gettext import gettext as _
  48.  
  49. VERSION   = "2.28.0"
  50. APPNAME   = _("glChess")
  51. ICON_NAME = 'gnome-glchess'
  52.  
  53. COPYRIGHT     = _('Copyright 2005-2008 Robert Ancell (and contributors)')
  54. DESCRIPTION   = _('The 2D/3D chess game for GNOME. \n\nglChess is a part of GNOME Games.')
  55. WEBSITE       = 'http://www.gnome.org/projects/gnome-games/'
  56. WEBSITE_LABEL = _('GNOME Games web site')
  57. AUTHORS       = ['Robert Ancell <bob27@users.sourceforge.net>\n'
  58.          'Andreas R├╕sdal <andreasr@gnome.org>']
  59. ARTISTS       = ['John-Paul Gignac (3D Models)', 'Max Froumentin (2D Models)', 'Hylke Bons <h.bons@student.rug.nl> (icon)']
  60.  
  61. # The GPL license string will be translated, and the game name inserted.
  62. # This license is the same as in libgames-support/games-stock.c 
  63. LICENSE = [_("%s is free software; you can redistribute it and/or modify " 
  64.        "it under the terms of the GNU General Public License as published by " 
  65.        "the Free Software Foundation; either version 2 of the License, or " 
  66.        "(at your option) any later version.").replace("%s", APPNAME),
  67. _("%s is distributed in the hope that it will be useful, "
  68.        "but WITHOUT ANY WARRANTY; without even the implied warranty of "
  69.        "MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the "
  70.        "GNU General Public License for more details.").replace("%s", APPNAME),
  71. _("You should have received a copy of the GNU General Public License "
  72.        "along with %s; if not, write to the Free Software Foundation, Inc., "
  73.        "51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA").replace("%s", APPNAME)]
  74.  
  75. # License for 2D models is the following, which is GPL compatible, and therefore not included in the license dialog:
  76. #2D Models:
  77. #Copyright World Wide Web Consortium, (Massachusetts Institute of Technology, Institut National de Recherche en Informatique et en Automatique, Keio University). All Rights Reserved. http://www.w3.org/Consortium/Legal/"""
  78.  
  79. try:
  80.     os.makedirs(DATA_DIR)
  81. except OSError, e:
  82.     if e.errno != errno.EEXIST:
  83.        print _('Unable to make data directory %(dir)s: %(error)s') % {'dir': DATA_DIR, 'error': e.strerror}
  84.